#coding:utf-8
from django.shortcuts import render
from django.http import HttpResponse,HttpResponseRedirect
import json

def success(req,msg,jumpUrl="",waitSecond=3):
  '成功提示'
  
  main_nav=[]
  main_nav.append({"url":"","name":"成功提示"})
  
  context={}
  context['main_nav']=main_nav
  context['message']=msg
  context['jumpUrl'] = jumpUrl
  context['waitSecond']=waitSecond
  return render(req, 'tips_jump.html', context)
  
def error(req,msg,jumpUrl="",waitSecond=3):
  '失败提示'
  
  main_nav=[]
  main_nav.append({"url":"","name":"失败提示"})
  
  context={}
  context['main_nav']=main_nav
  context['error']=msg
  context['jumpUrl'] = jumpUrl
  context['waitSecond']=waitSecond
  return render(req, 'tips_jump.html', context)

def returnAjax(rt):
  return HttpResponse(json.dumps(rt),content_type="application/json")
  
